home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Miami / MiamiSDK / netinclude / netinet / ip6.h < prev    next >
C/C++ Source or Header  |  1997-12-06  |  3KB  |  128 lines

  1. #ifndef _NETINET_IP6_H_
  2. #define _NETINET_IP6_H_
  3.  
  4. #ifndef _SYS_TYPES_H_
  5. #include <sys/types.h>
  6. #endif
  7.  
  8. #ifndef _NETINET_IN_H_
  9. #include <netinet/in.h>
  10. #endif
  11.  
  12. /*
  13.  * Definitions for internet protocol version 6.
  14.  * Per RFC 1883
  15.  */
  16.  
  17. /*
  18.  * Structure of an IPv6 (first) header.
  19.  */
  20.  
  21. struct ipv6 {
  22.     u_int32_t ip6_head;        /* version and flow label */
  23.     u_int16_t ip6_len;        /* payload length */
  24.     u_int8_t  ip6_nh;        /* next header */
  25.     u_int8_t  ip6_hlim;        /* hop limit */
  26.     struct    in6_addr ip6_src;    /* source address */
  27.     struct      in6_addr ip6_dst;    /* destination address */
  28. };
  29.  
  30. #define IP6_MMTU    576        /* minimal MTU and reassembly */
  31.  
  32. /*
  33.  * Definitions of next header field values.
  34.  */
  35.  
  36. #define IP6_NHDR_HOP    0    /* hop-by-hop IPv6 header */
  37. #define IP6_NHDR_RT    43    /* routing IPv6 header */
  38. #define IP6_NHDR_FRAG    44    /* fragment IPv6 header */
  39. #define IP6_NHDR_AUTH    51    /* authentication IPv6 header */
  40. #define IP6_NHDR_ESP    50    /* encryption IPv6 header */
  41. #define IP6_NHDR_DOPT    60    /* destination options IPv6 header */
  42. #define IP6_NHDR_NONH    59    /* no next header */
  43.  
  44. /*
  45.  * Fragment Header.
  46.  */
  47.  
  48. struct ipv6_fraghdr {
  49.     u_int8_t  if6_nh;    /* next header */
  50.     u_int8_t  if6_res;    /* reserved */
  51.     u_int16_t if6_off;    /* offset */
  52. #define IP6_MF 0x1        /* more flag */
  53. #define IP6_OFFMASK 0xfff8    /* mask of real offset field */
  54.     u_int32_t if6_id;    /* identifier */
  55. };
  56.  
  57. /*
  58.  * Hop-by-Hop Options Header.
  59.  */
  60.  
  61. struct ipv6_h2hhdr {
  62.     u_int8_t  ih6_nh;    /* next header */
  63.     u_int8_t  ih6_hlen;    /* header extension length */
  64.     u_int16_t ih6_pad1;    /* to 4 byte length */
  65.     u_int32_t ih6_pad2;    /* to 8 byte length */
  66. };
  67.  
  68. /*
  69.  * Routing Header.
  70.  */
  71.  
  72. struct ipv6_rthdr {
  73.     u_int8_t  ir6_nh;    /* next header */
  74.     u_int8_t  ir6_hlen;    /* header extension length */
  75.     u_int8_t  ir6_type;    /* routing type */
  76. #define IP6_LSRRT 0        /* type 0: loose source route */
  77.     u_int8_t  ir6_sglt;    /* index of next address */
  78.     u_int32_t ir6_slmsk;    /* strict/loose bit mask */
  79. };
  80. #define IP6_RT_MAX    23    /* maximum number of addresses */
  81. #define IP6_RT_SLMSK    0x00ffffff
  82. #define IP6_RT_SLBIT(n)    (1 << (IP6_RT_MAX - n))
  83.  
  84. /*
  85.  * Destination Options Header.
  86.  */
  87.  
  88. struct ipv6_dopthdr {
  89.     u_int8_t  io6_nh;    /* next header */
  90.     u_int8_t  io6_hlen;    /* header extension length */
  91.     u_int16_t io6_pad1;    /* to 4 byte length */
  92.     u_int32_t io6_pad2;    /* to 8 byte length */
  93. };
  94.  
  95. /*
  96.  * Authentication Header.
  97.  */
  98.  
  99. struct ipv6_authhdr {
  100.     u_int8_t  ah6_nh;    /* next header */
  101.     u_int8_t  ah6_hlen;    /* header extension length */
  102.     u_int16_t ah6_pad;    /* to 4 byte length */
  103.     u_int32_t ah6_spi;    /* security parameter index */
  104. };
  105.  
  106. /*
  107.  * Encryption Security Payload Header.
  108.  */
  109.  
  110. struct ipv6_esphdr {
  111.     u_int32_t esp6_spi;    /* security parameter index */
  112. };
  113.  
  114. #define IP6_OPT_PAD1    0    /* one-byte pad option type */
  115. #define IP6_OPT_PADN    1    /* N-byte pad option type */
  116.  
  117. /*
  118.  * IPv6 implementation parameters.
  119.  */
  120.  
  121. #define    IP6FRAGTTL    120        /* time to live for frags, slowhz */
  122.  
  123. #endif
  124.  
  125.  
  126.  
  127.  
  128.